package com.wlz.testMain;

import com.alibaba.fastjson.JSONObject;
import com.wlz.utils.HttpClientUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * @author： wlz
 * @Date 2021/1/7 10:52
 * @description： TODO
 * @version: 1.0
 */
public class HttpClientMain {

    public static void main(String[] args) throws Exception {

        String pathUrl = "https://haoma.baidu.com/api/v1/search";
        Map<String,Object> map = new HashMap<>();
        map.put("data","e0aed2a1a92efaf4fe82ae634e34ef372fa127e168d4c339426dd8a507b203205e657981a1dc175c085d99e098e9f92b729b8df9dcffddf5cbfc4b21bc4e704793fe97289dbc547a80ece50234bb3510db5f23ac025611d55b0f8c2955394365b2d33fdd3ee4cd8d99f050ce38641d4ca8c60477449b70361dbf1d55a65d7c6b");
        map.put("key_id","14");
        map.put("page",1);
        map.put("search","01067442326");
        map.put("sign","54510802");
        map.put("size",10);
        String result = HttpClientUtil.postJSON(pathUrl, JSONObject.toJSONString(map));
        System.out.println(JSONObject.parse(result));
    }
}

